package com.jabex.core.bussines;

import com.jabex.common.exceptions.ErrorFunctionalException;
import com.jabex.common.exceptions.ErrorOperationalException;
import com.jabex.common.exceptions.WarningFunctionalException;
import com.jabex.common.to.MessageTO;
import com.jabex.common.to.ProductTO;

import java.io.Serializable;
import java.util.List;

/**
 * Created by jaugusto on 15/09/14. *
 */
public interface IProductBp extends Serializable {
	public static final String SERVICE_NAME = "productBp";

	/**
	 * insert a  new product
	 *
	 * @param productTO object witch contains info the product.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO insertProduct(ProductTO productTO) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * delete a  product
	 *
	 * @param id the product.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO deleteProduct(int id) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * update a  new product
	 *
	 * @param productTO object witch contains info the product to update.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO updateProduct(ProductTO productTO) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * get  a  product by id
	 *
	 * @param id product from search
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public ProductTO getProductById(int id) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * get  all  users
	 *
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public List<ProductTO> getAllProduct() throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;


}
